package com.example.tests;

import java.util.Set;

import org.testng.annotations.Test;

public class GroupModifyTests extends TestBase {

	@Test
	public void testFirstGroupCanBeModified() throws Exception {
		GroupObject validGroup = new GroupObject()
			.setName("grbr2")
	        .setHeader("grbrh2")				
			.setFooter("grbrf2");
		Set<GroupObject> oldList = app.getGroupHelper().getGroups();
		//action
		if (oldList.size() == 0){			
			GroupObject groupObject = new GroupObject()
			.setName("")
			.setHeader("")
			.setFooter("");
			app.getGroupHelper().createGroup(groupObject);
		    oldList.add(groupObject);
		}
		/*GroupObject modifiedGroup = app.getGroupHelper().getGroupRandom(oldList);
		String groupId = modifiedGroup.id;*/
		app.getGroupHelper().modifyGroup(validGroup);
		//verification
		Set<GroupObject> newList = app.getGroupHelper().getGroups();
		verifyGroupModified(oldList,/*modifiedGroup, validGroup,*/ newList);
	}
	
}